from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
driver = webdriver.Edge()
driver.get('http://10.59.9.14:7003/')
# 点击登录
driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
# 输入账号
driver.find_element(By.CLASS_NAME,'regi-input').send_keys('15232008902')
# 输入密码
driver.find_element(By.NAME,'password').send_keys('123456')
sleep(15)
driver.find_element(By.XPATH,'/html/body/div[4]/div/div[1]/div[2]/form/div[5]/a').click()
sleep(5)
# 点击登录
# 隐式等待
driver.implicitly_wait(5)
driver.find_element(By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a').click()
# 输入文字
shuru=driver.find_element(By.CLASS_NAME,'search-input')
shuru.send_keys('龙虾')
# shuru.find_element(Keys.ENTER)
# 打印文本6
print(shuru)
driver.find_element(By.XPATH,'//*[@id="searchForm"]/div[2]/input').click()
driver.find_element(By.XPATH,'/html/body/div[5]/div[2]/div[2]/div[1]/ul/li/div[1]/span/a/img').click()
sleep(2)
# id获取
dr=driver.find_element(By.ID,'store_nums')
dr.clear()
dr.send_keys('2')
# 显示等待
aa = WebDriverWait(driver,20,1).until(EC.presence_of_element_located((By.CLASS_NAME,'shop-btn')))
aa.click()
# driver.switch_to.window('window.scrollTo(0,200)')

driver.find_element(By.ID,'order-button').click()
sleep(2)


sleep(10)
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# from time import sleep
# from selenium.webdriver.support.ui import WebDriverWait
# from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.common.keys import Keys
# driver = webdriver.Edge()
# driver.get('https://www.baidu.com/')
# driver.find_element(By.CLASS_NAME,'soutu-btn').click()
# aa=driver.find_element(By.CLASS_NAME,'upload-pic')
# aa.send_keys(r"C:\Users\24108\Desktop\屏幕截图 2025-06-25 101843.png")
# sleep(10)
# from selenium import webdriver
# from selenium.webdriver.common.by import By
# from time import sleep
# from selenium.webdriver.support.ui import WebDriverWait
# from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.common.keys import Keys
# driver = webdriver.Edge()
# driver.get('https://mindnow.shxycxx.com/baidu1?utm_source=baidu&utm_campaign=591063625&utm_content=10218831603&utm_term=859764086284&creative=99752777754&bd_vid=10682386198618699601')
# aa=driver.find_element(By.XPATH,'/html/body/div/div[1]/div/div/div/div/div[1]/a/div')
# aa.click()
# sleep(10)
